//
//  HisRltCell.m
//  夺宝吧
//
//  Created by xiaocai on 15/8/19.
//  Copyright (c) 2015年 FangYuan. All rights reserved.
//

#import "HisRltCell.h"
#import "ShowNumView.h"
@interface HisRltCell ()
{
    __weak IBOutlet UIImageView *img;
    __weak IBOutlet UILabel *titleLab;
    __weak IBOutlet UILabel *allLab;
    __weak IBOutlet UILabel *cyLab;
    
    __weak IBOutlet UILabel *nameLab;
    __weak IBOutlet UILabel *codeLab;
    __weak IBOutlet UILabel *countLab;
    
    __weak IBOutlet UILabel *timeLab;
    
    
     RecordHisModel *_currentModel;
}
@end
@implementation HisRltCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [self addSubview:[WYPublic getFenGexian:0 :self.frame.size.height - 0.5 :WYMWITH :0.5]];
}
- (void)fillCellWithModel:(RecordHisModel *)model
{
    _currentModel = model;
    [img sd_setImageWithURL:[NSURL URLWithString:model.his_record_imgPath] placeholderImage:[UIImage imageNamed:@"moren"]];
    titleLab.text = [NSString stringWithFormat:@"(第%@期)%@",model.his_record_qishu,model.his_record_title];
    
    cyLab.attributedText = [WYPublic getRedMiddleStrWithLeft:@"参与次数:" Middle:model.his_record_gonumber RightStr:@"次" Font:12];
    allLab.text = [NSString stringWithFormat:@"总需:%@次",model.his_all_need];
    
    nameLab.text = model.his_owner_name;
    codeLab.text = model.his_owner_code;
    countLab.attributedText = [WYPublic getRedMiddleStrWithLeft:@"" Middle:model.his_owner_count RightStr:@"次" Font:12];
    timeLab.text = model.his_owner_time;
}

- (IBAction)show:(id)sender {
    ShowNumView *his = [[ShowNumView alloc]initWithArr:_currentModel.his_record_nums AndQiShu:_currentModel.his_record_qishu AndTitle:_currentModel.his_record_title];
    his.owner_code = _currentModel.his_owner_code;
    UIWindow *window = [UIApplication sharedApplication].delegate.window;
    [window addSubview:his];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
